package com.javaweb.cwj.controller;


import com.javaweb.cwj.R;
import com.javaweb.cwj.entity.subject.OneSubject;
import com.javaweb.cwj.entity.subject.TwoSubject;
import com.javaweb.cwj.service.EduSubjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * <p>
 * 璇剧▼绉戠洰 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2021-05-12
 */
@RestController
@RequestMapping("/eduService/edu-subject")
@CrossOrigin
public class EduSubjectController {
   @Autowired
    private EduSubjectService eduSubjectService;
   @PostMapping("upload")
   public R addSubject(MultipartFile file){
       eduSubjectService.saveSubject(file,eduSubjectService);
      return  R.ok();
   }
   @GetMapping("findAllSubject")
 public R findOneSubjctORTwoSubject(){
    List<OneSubject> oneSubjectList =eduSubjectService.findOneService();
       return R.ok().data("list",oneSubjectList);
 }


 }


